<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>权限--layui后台管理模板</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../../public/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../../../public/css/public.css" media="all" />
	<style>
		.layui-textarea{padding: 10px;}
		.layui-colla-item{position: relative;}
		.layui-colla-item > .layui-form-checkbox[lay-skin=primary]{margin-top: 0; position: absolute; top: 10px; left: 60px; height: 20px !important;z-index: 999;}
		.layui-colla-item.on > .layui-form-checkbox[lay-skin=primary] i:before{position: absolute; top: 4px; left: 4px;
			content: ''; display: block; width: 8px; height: 8px; background: #5fb878;}
		.layui-colla-item.on > .layui-form-checked[lay-skin=primary] i{background: #fff;}
		.layui-colla-title{ height: 38px; line-height: 38px; padding: 0 10px 0 35px; }

		.layui-colla-content{padding-left: 80px;}
		.layui-colla-content .layui-form-label{text-align: left; padding: 0; width: 180px;}
		.layui-colla-content .layui-form-label .layui-form-checkbox[lay-skin=primary] span{color: #009688;}
		.layui-colla-content .layui-form-item.on .layui-form-label .layui-form-checkbox[lay-skin=primary] i:before{position: absolute; top: 4px; left: 4px;
			content: ''; display: block; width: 8px; height: 8px; background: #5fb878;}
		.layui-colla-content .layui-form-item.on .layui-form-label .layui-form-checked[lay-skin=primary] i{background: #fff;}
		.layui-colla-content .layui-input-block{margin-left: 220px;}
		.layui-colla-content .layui-input-block .layui-form-checkbox[lay-skin=primary]{margin-top: 0; margin-right: 10px;}

		.layui-colla-content .layui-form-item{margin-bottom: 0; padding-bottom: 10px; padding-top: 0;}
		.layui-colla-content .layui-form-item:first-child{ padding-top: 5px;}

		.layui-colla-content .three .layui-form-item{padding-bottom: 0; padding-top: 0px; position: relative;}

		.layui-colla-content .three .layui-form-label .layui-form-checkbox[lay-skin=primary] span{color: #999;}
		.layui-colla-content .three .layui-form-label .layui-form-checkbox[lay-skin=primary]{padding-left: 20px;}

		/*		.layui-colla-content .three .layui-form-item::before{
                    content:'';position:absolute;left:0;line-height:0;margin:0;padding:0;width:21px;height:36px;display:inline-block;
                    vertical-align:middle;border:0 none;cursor:pointer;outline:none;background-color:transparent;background-repeat:no-repeat;background-attachment:scroll;
                    background-image:url(../../../public/plugin/zTree/css/metroStyle/img/metro.png);background-position:-84px -12px;}*/
		.layui-colla-content .three .layui-form-item:last-child:before{height: 20px;}
		@media (max-width: 767px){
			/*.layui-colla-content{padding-left: 10px;}*/
			.phone> .layui-input-block{width: 100%; margin-left: 0; float: left; }
			.layui-colla-content .layui-input-block{margin-left: 30px;float: left;}
			.layui-colla-content .three .layui-input-block{margin-left: 50px;}
		}
	</style>
</head>
<body class="childrenBody">
<form class="layui-form layui-col-lg-offset2 layui-col-lg8 layui-col-md-offset1 layui-col-md10" id="editRoleForm">
	<input type="text" hidden name="" id="getRoleName" value="{{roleName}}" >
	<input type="hidden" name="id" id="id" value="{{id}}"/>
	<div class="layui-form-item">
		<div class="layui-form-label"><span style="color: red">*</span>角色名称</div>
		<div class="layui-input-block">
			<input type="text" name="roleName" id="roleName" value="{{roleName}}" lay-verify="required||TheOnlyName" placeholder="请输入角色名称" autocomplete="off" class="layui-input newsTitle" >
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label"><span style="color: red">*</span>角色编码</div>
		<div class="layui-input-block">
			<input type="text" name="roleCode" readonly="" value="{{roleCode}}" id="roleCode" lay-verify="required" placeholder="请输入角色编码" autocomplete="off" class="layui-input author">
		</div>
	</div>
	<div class="layui-form-item layui-form-text">
		<div class="layui-form-label">角色描述</div>
		<div class="layui-input-block">
			<textarea placeholder="请输入角色描述（选填）" name="description" id="description" class="layui-textarea">{{description}}</textarea>
		</div>
	</div>
	<div class="layui-form-item phone">
		<div class="layui-form-label">角色权限</div>
		<div class="layui-input-block">
			<div class="layui-collapse" id="context">
				{{each menuList}}
				<div class="layui-colla-item">
					<input type="checkbox" lay-filter="menuNameList"  value="{{$value.id}}" lay-skin="primary" title="{{$value.menuName}}">
					<h2 class="layui-colla-title"></h2>
					<div class="layui-colla-content">
						{{each $value.children as childrenObj index}}
						<div class="layui-form-item twoMenu">
							<div class="layui-form-label">
								{{if childrenObj.sysMetadataList.length == 0}}
									{{if childrenObj.isJurisdiction == 1}}
										<input type="checkbox" checked lay-skin="primary" lay-filter="twoMenu" value="{{childrenObj.id}}" title="{{childrenObj.menuName}}">
									{{else}}
										<input type="checkbox" lay-skin="primary" lay-filter="twoMenu" value="{{childrenObj.id}}" title="{{childrenObj.menuName}}">
									{{/if}}
								{{else}}
								<input type="checkbox" lay-skin="primary" lay-filter="twoMenu"  title="{{childrenObj.menuName}}">
								{{/if}}
							</div>
							{{if childrenObj.children.length == 0}}
							<div class="layui-input-block">
								{{each childrenObj.sysMetadataList as sysMetadataObj index}}
									{{if index == 0 }}
										{{if childrenObj.isJurisdiction == 1}}
											<input type="checkbox" checked  lay-skin="primary" lay-filter="metadata" value="{{childrenObj.id}}"  title="查询">
										{{else}}
											<input type="checkbox" lay-skin="primary" lay-filter="metadata" value="{{childrenObj.id}}"  title="查询">
										{{/if}}
									{{/if}}
									{{if childrenObj.isJurisdiction == 1}}
										<input type="checkbox" checked  lay-skin="primary" lay-filter="metadata" value="{{childrenObj.id}}-{{sysMetadataObj.id}}"  title="{{sysMetadataObj.metadataName}}">
									{{else}}
										<input type="checkbox" lay-skin="primary" lay-filter="metadata" value="{{childrenObj.id}}-{{sysMetadataObj.id}}"  title="{{sysMetadataObj.metadataName}}">
									{{/if}}
								{{/each}}
							</div>
							{{/if}}
						</div>
						<div class="three">
							{{each childrenObj.children as threeChildren index}}
							<div class="layui-form-item threeMenu">
								<div class="layui-form-label">
									{{if threeChildren.sysMetadataList.length == 0 }}
										{{if threeChildren.isJurisdiction == 1}}
											<input type="checkbox" checked lay-skin="primary" lay-filter="threeMenu" value="{{threeChildren.id}}"  title="{{threeChildren.menuName}}">
										{{else}}
											<input type="checkbox" lay-skin="primary" lay-filter="threeMenu" value="{{threeChildren.id}}"  title="{{threeChildren.menuName}}">
										{{/if}}
									{{else}}
									<input type="checkbox" lay-skin="primary" lay-filter="threeMenu" title="{{threeChildren.menuName}}">
									{{/if}}
								</div>
								<div class="layui-input-block">
									{{each threeChildren.sysMetadataList as sysMetadata index}}
										{{if index == 0}}
											{{if threeChildren.isJurisdiction == 1}}
												<input type="checkbox" checked lay-filter="metadata" value="{{threeChildren.id}}" lay-skin="primary" title="查询">
											{{else}}
												<input type="checkbox" lay-filter="metadata" value="{{threeChildren.id}}" lay-skin="primary" title="查询">
											{{/if}}
										{{/if}}
										{{if sysMetadata.isJurisdiction == 1}}
											<input type="checkbox" checked lay-filter="metadata" value="{{threeChildren.id}}-{{sysMetadata.id}}" lay-skin="primary" title="{{sysMetadata.metadataName}}">
										{{else}}
											<input type="checkbox" lay-filter="metadata" value="{{threeChildren.id}}-{{sysMetadata.id}}" lay-skin="primary" title="{{sysMetadata.metadataName}}">
										{{/if}}
									{{/each}}
								</div>
							</div>
							{{/each}}
						</div>
						{{/each}}
					</div>
				</div>
				{{/each}}
			</div>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
			<a class="layui-btn" lay-filter="editRole" lay-submit="">立即提交</a>
			<a class="layui-btn layui-btn-primary" onclick="layuiFunciton.closeOpen()">返回</a>
		</div>
	</div>
</form>
</body>
<script type="text/javascript" src="/public/js/jquery.min.js"></script>
<script type="text/javascript" src="/public/layui/layui.js"></script>
<script  type="text/javascript" src="/js/public.function.js"></script>
<script  type="text/javascript" src="js/edit.js"></script>
</html>